package cn.wsalix.templet.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.anlaser.entity.SimpleEntity;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author jskyme 模板位置
 * @deprecated
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "SITE_PLACE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
@Data
@EqualsAndHashCode(callSuper = false)
public class SitePlace extends SimpleEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2275893724710915295L;
	private String placeCode;//
/*	@JsonIgnore
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sitePlace")
	private List<SitePagePlace> siteTempletPlaces;
*/	/**
	 * 模块对应的文件
	 */
	@Column(name = "TEMP_PART_FILE", nullable = true, length = 255)
	private String tempPartFile;//
	/**
	 * 请求参数条件
	 * 1,单篇文章ID
	 * 2,多篇文章分类ID
	 * 3,单个菜单ID
	 * 4,多个菜单父ID
	 * 5,广告图文组父ID
	 */
	private long paraValue;
	private String  paraShow;
	/**
	 * 获取的记录个数
	 */
	private int resultSize;
	// 位置对应数据
	// 菜单
	// 文章列表
	// 文章分类
	// 广告
/*	@JsonIgnore
	@ManyToOne(cascade=CascadeType.MERGE,optional=true,fetch=FetchType.LAZY)
	@JoinColumn(name = "TEMPLET_PLACE_ID")
	private TempletPagePlace TempletPlace;
	
	@ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "PAGE_DATA_ID")
	private PageData pageData;*/
	@Transient
	private Long pageDataId;
}
